=========================================================================== BBS: The Abacus * HST/DS * Potterville, MI Date: 02-14-93 (00:10) Number: 102 From: HERMAN NIEUWENDAAL Refer#: NONE To: STEVE SPENCER Recvd: NO Subj: Re: Military time to Norm Conf: (35) Quick Basi --------------------------------------------------------------------------- SS> taking the system time (in millitary form) and converting it to normal SS> time (1-12) with a PM or AM on the end. Can anyone help me with this. Here's a function that does what you need. It will work with the standard 5 or 8 character time formats. (HH:MM or HH:MM:SS) >---------------------------------------------------------< DECLARE FUNCTION StdTime$ (tme$) '24 hour to 12 hour format conversion function 'Examples of usage: PRINT StdTime$(TIME$) ' PRINT StdTime$("18:24") FUNCTION StdTime$ (tme$) SELECT CASE LEFT$(tme$, 2) CASE "00" MID$(tme$, 1, 2) = "12" x$ = "am" CASE "01" TO "09" MID$(tme$, 1, 2) = STR$(VAL(LEFT$(tme$, 2))) x$ = "am" CASE "10" TO "11" x$ = "am" CASE "12" x$ = "pm" CASE "13" TO "21" MID$(tme$, 1, 2) = STR$(VAL(LEFT$(tme$, 2)) - 12) x$ = "pm" CASE "22" TO "23" MID$(tme$, 1, 2) = LTRIM$(STR$(VAL(LEFT$(tme$, 2)) - 12)) x$ = "pm" END SELECT StdTime$ = LEFT$(tme$, 5) + x$ END FUNCTION >---------------------------------------------------------< ... Herman --- FMail 0.92 * Origin: Software Heaven (813)653-0029 (1:377/41.0) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20